<?php

namespace common\validate;

class Media extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    // AddMediaUploadServer 验证场景定义
    public function sceneAddMediaUploadServer()
    {
        return $this->append('data.name', 'require|max:128')
            ->append('data.access_key', 'require|max:128')
            ->append('data.secret_key', 'require|max:128')
            ->append('data.request_url', 'require|max:255')
            ->append('data.upload_url', 'require|max:255');
    }

    // CreateMedia 创建一个媒体资源
    public function sceneCreateMedia()
    {
        return $this->append("path", "require")
            ->append("md5_name", "require")
            ->append("type", "require");
    }
}
